//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "PV3D.h"

void PV3D::normalizar(){
        float modulo = sqrt(pow(x,2) + pow(y,2) + pow(z,2));
        x = x/modulo;
        y = y/modulo;
        z = z/modulo;
}

PV3D* PV3D::clona(){
        return new PV3D(x,y,z,pv);
}

float PV3D::productoEscalar(PV3D* v){
        return x*v->x + y*v->y + z*v->z;
}

PV3D* PV3D::productoVectorial(PV3D* v){
        float resX = y*v->z - z*v->y;
        float resY = z*v->x - x*v->z;
        float resZ = x*v->y - y*v->x;
        return new PV3D(resX,resY,resZ,0);
}

//---------------------------------------------------------------------------

#pragma package(smart_init)
 